home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / sftwist.lha / CreaterTwist.c next >
C/C++ Source or Header  |  1993-07-19  |  2KB  |  81 lines

  1. ;/*
  2. SC DATA=NEAR NOSTKCHK LINK NOICON CreaterTwist.c
  3. quit
  4. */
  5.  
  6. #include <exec/types.h>
  7. #include <stdio.h>
  8.  
  9. main()
  10. {
  11.   WORD width, deltastab;
  12.   WORD delta,position;
  13.   WORD takeoff;
  14.  
  15.   for(width=2; width<=320; width+=2)
  16.     {
  17.       printf("label_w%d:\n",width);
  18.       delta=160; position=-1;
  19.       takeoff=(320-width)/2;
  20.       if((takeoff&15)==0)
  21.         {
  22.           if(takeoff)
  23.             {
  24.               if((takeoff/16)>1)
  25.                 {
  26.                   printf(" adda.w #%d,a2\n",(((takeoff/16)-1)*2));
  27.                 }
  28.               printf(" move.w d7,(a2)+\n");
  29.             }
  30.         }
  31.       else
  32.         {
  33.           if(takeoff>15)
  34.             {
  35.               printf(" adda.w #%d,a2\n",((takeoff/16)*2));
  36.             }
  37.         }
  38.       takeoff&=15;
  39.       for(deltastab=0; deltastab<width; deltastab++)
  40.         {
  41.           while(delta>=0)
  42.             {
  43.               position++;
  44.               delta-=width;
  45.             }
  46.           if(deltastab)
  47.             {
  48.               printf(" add.w  d7,d7\n");
  49.             }
  50.           printf(" or.b   %d(a3),d7\n",position);
  51.           if((++takeoff)==16)
  52.             {
  53.               takeoff=0;
  54.               printf(" move.w d7,(a2)+\n");
  55.             }
  56.           delta+=320;
  57.         }
  58.       if(takeoff)
  59.         {
  60.           if(takeoff<8)
  61.             {
  62.               printf(" lsl.w  #7,d7\n");
  63.               takeoff+=7;
  64.             }
  65.           if(takeoff==15)
  66.             {
  67.               printf(" add.w  d7,d7\n");
  68.             }
  69.           else
  70.             {
  71.               printf(" lsl.w  #%d,d7\n",(16-takeoff));
  72.             }
  73.           printf(" move.w d7,(a2)\n");
  74.         }
  75.       else
  76.         {
  77.           printf(" move.w #0,(a2)\n");
  78.         }
  79.       printf(" rts\n");
  80.     }
  81. }